//
//  ActiveTrailerService.m
//  homeland
//
//  Created by Alawn on 14-1-19.
//  Copyright (c) 2014年 xzysun. All rights reserved.
//

#import "ActiveTrailerService.h"
#import "NoticesItem.h"
#import "StreetInfoCell.h"
@implementation ActiveTrailerService
-(id)init
{
    self = [super init];
    if (self) {
        _dataItemName = @"NoticesItem";
    }
    return self;
}

-(void)loadDataWithKey:(NSString *)keyOrNil
{
    _currentPageNo = 1;//刷新或查询的时候将请求页码变为1
    if (self.dataList) {
        self.dataList = nil;
    }
    NSMutableDictionary *params = [NSMutableDictionary dictionary];
//    NoticesItem *item = (NoticesItem *)self.dataItem;
    [params setValue:@"'活动预告'" forKey:@"type"];
    if (keyOrNil) {
        [params setValue:keyOrNil forKey:@"title"];
    } else {
        [params setValue:@"" forKey:@"title"];
    }
    [self doHttpPost:SERVER_URL_INFO_NOTICE headers:nil path:[NSString stringWithFormat:@"/%d",_currentPageNo] parameters:params];
}

-(void)loadMoreDataWithKey:(NSString *)keyOrNil
{
    NSMutableDictionary *params = [NSMutableDictionary dictionary];
//    NoticesItem *item = (NoticesItem *)self.dataItem;
    if (keyOrNil) {
        [params setValue:keyOrNil forKey:@"title"];
    } else {
        [params setValue:@"" forKey:@"title"];
    }
    [self doHttpPost:SERVER_URL_INFO_NOTICE headers:nil path:[NSString stringWithFormat:@"/%d",_currentPageNo] parameters:params];
}
-(void)configCell:(UITableViewCell *)cell atIndex:(NSIndexPath *)index
{
    NoticesItem *item = [self.dataList objectAtIndex:index.row];
    StreetInfoCell *tempCell = (StreetInfoCell *)cell;
    tempCell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    tempCell.titleLabel.text = item.title;
}


@end
